/*
        Powered by. XPGA::Valhalla Engine 
        Aisyren, ELIA.
*/


import java.awt.Color;

public class TestCar
{
	public static void main(String[] argv)
	{
		Automobile[] fleet = new Automobile[3];
		fleet[0] = new Sedan(Color.black);
		fleet[1] = new Minivan(Color.blue);
		fleet[2] = new SportsCar(Color.red);

		// VER 1.0 ENGAGE
		int totalcap = 0;

		for(int i = 0; i < fleet.length; i++)
		{
			if(fleet[i] instanceof Sedan)
			{
				totalcap += ((Sedan) fleet[i]).getCapacity();
			}
			else if(fleet[i] instanceof Minivan)
                        {
                                totalcap += ((Minivan) fleet[i]).getCapacity();
                        }
			else if(fleet[i] instanceof SportsCar)
                        {
                                totalcap += ((SportsCar) fleet[i]).getCapacity();
                        }
			else
			{
				totalcap += fleet[i].getCapacity();
			}
		}


		System.out.println("VERSION 1.0 TOTAL CAP = " + totalcap);


		// VER 2.0 ENGAGE
		totalcap = 0;

		for(int i = 0; i < fleet.length; i++)
		{
			totalcap += fleet[i].getCapacity();
		}


		System.out.println("VERSION 2.0 TOTAL CAP = " + totalcap);
	}
}

